package com.cn.demo4.servlet.admin.navType;

import com.alibaba.fastjson.JSONObject;
import com.cn.demo4.model.NavTypeModel;
import com.cn.demo4.service.INavTypeService;
import com.cn.demo4.service.impl.NavTypeServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/admin/navType/findAll")
public class NavTypeFindAllServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        INavTypeService iNavTypeService = new NavTypeServiceImpl();
        List<NavTypeModel> list = iNavTypeService.findAll();

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("list",list);
        resp.getWriter().println(jsonObject);




    }
}
